package com.flash.mapper;


import com.flash.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.Map;

@Mapper
public interface UserMapper {

    /**
     * 根据openid查找用户
     * @param openId
     * @return
     */
    @Select("select  * from  flash_delivery.user where openid = #{openId} ")
    User getByOpenId(String openId);

    /**
     * 插入用户信息数据
     * @param user
     */
    void insertUser(User user);

    @Select("select * from flash_delivery.user where id = #{userId} ")
    User getById(Long userId);


    /**
     * 新用户和用户统计
     * @param map
     * @return
     */
    Integer countByMap(Map map);


}
